package sbpme.designer.command;

import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.commands.Command;

import sbpme.designer.model.Activity;


public class ActivityChangeConstraintCommand  extends Command {
	
	private Activity activity;
	private Rectangle oldConstraint;
	private Rectangle newConstraint;
	
	public void execute() {
		oldConstraint = new Rectangle(activity.getConstraint());
		activity.setConstraint(newConstraint);
	}
	
	public void undo() {
		activity.setConstraint(oldConstraint);
	}

	public void setNewConstraint(Rectangle newConstraint) {
		this.newConstraint = newConstraint;
	}
	
	public void setActivity(Activity activity) {
		this.activity = activity;
	}
	
}